﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace LyncServerExtension.Plugin.WebPage
{
    /// <summary>
    /// Class to represent the delegation web page.
    /// </summary>
    public sealed class DelegationPage : DefaultPage
    {
        private LyncCallForwardingParameter param;

        /// <summary>
        /// Gets the content.
        /// </summary>
        public override string Content
        {
            get
            {
                return string.Format("<h3>{0}</h3><hr/><p>{1}</p>",
                    Title, string.Format(param.IsEnabled
                        ? "Call forwarding delegation has been enabled for {0} by {1}."
                        : "Call forwarding delegation has been disabled for {0} by {1}.",
                        param.DelegateSip, param.OwnerSip));
            }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="DelegationPage"/> class.
        /// </summary>
        /// <param name="param">The call forwarding parameters.</param>
        public DelegationPage(LyncCallForwardingParameter param)
        {
            this.param = param;
        }
    }
}
